﻿using ImoviesBlazorAntPro.Shared.Entities;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ImoviesBlazorAntPro.Server.Repository
{
    public interface ITeleplayRepository
    {
        /// <summary>
        /// 获取全部数据
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Teleplay>> GetAllListAsync();

        /// <summary>
        /// 分页获取数据
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageNum"></param>
        /// <returns></returns>
        Task<IEnumerable<Teleplay>> GetListAsync(int pageSize, int pageNum);

        /// <summary>
        /// 分页获取纯列表
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageNum"></param>
        /// <returns></returns>
        Task<IEnumerable<Teleplay>> GetPureListAsync(int pageSize, int pageNum);

        /// <summary>
        /// 获取视频播放链接
        /// </summary>
        /// <param name="vid">视频id</param>
        /// <returns></returns>
        Task<IEnumerable<TeleplayVlink>> GetVlinkList(string vid);

        /// <summary>
        /// 获取所有年份
        /// </summary>
        /// <returns></returns>
        IEnumerable<uint> GetAllYears();

        /// <summary>
        /// 获取总记录数
        /// </summary>
        /// <returns></returns>
        int GetTotal();

        /// <summary>
        /// 搜索
        /// </summary>
        /// <returns></returns>
        IEnumerable<Teleplay> Search(string keyword);

        /// <summary>
        /// 添加电视剧
        /// </summary>
        /// <param name="teleplay"></param>
        void AddTeleplay(Teleplay teleplay);

        /// <summary>
        /// 修改电视剧
        /// </summary>
        /// <param name="teleplay"></param>
        void UpdateTeleplay(Teleplay teleplay);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="teleplayId"></param>
        Task DeleteTeleplay(string teleplayId);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        void DeleteBatch(List<string> ids);

        /// <summary>
        /// 保存操作
        /// </summary>
        /// <returns></returns>
        bool Save();

    }
}
